Conversation
…for test addresses (#4466)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| 'network' in cardanoAction ? cardanoAction.network : undefined | ||
| if (actionNetwork && actionNetwork !== currentNetwork) { | ||
| walletManager.setSelectedNetwork(actionNetwork) | ||
| } |
There was a problem hiding this comment.
Network switch race condition in deep link handling
High Severity
When processing deep links with a different network (e.g., a preprod address when user is on mainnet), walletManager.setSelectedNetwork(actionNetwork) is called but returns immediately without waiting for completion. The setSelectedNetwork method triggers an async hydrateFn() that reloads wallets and only updates the network state in its .then() callback. The code then immediately processes the action (setting transfer state, navigating) before the network switch completes. This could result in transactions being prepared against the wrong network context.
Note
Medium Risk
Medium risk because it changes migration/storage recovery behavior (including clearing data while preserving keystore) and alters deep-link parsing/execution to auto-switch networks, which can impact wallet availability and transfer flows.
Overview
Improves startup resilience by adding storage integrity checks, timeouts, and automatic recovery during migrations:
runMigrationsnow validates MMKV/AsyncStorage health and attempts recovery,useMigrationsenforces a 60s timeout, retries on critical failures, and can clear recoverable data while preservingkeystore/.Adds wallet metadata recovery via
recoverOrphanedWallets(rebuilds missingwallet/metas fromkeystore/xpub/xpriv) and makesWalletManagerHydrationWrapper/WalletManager.hydratemore defensive (timeouts + error-handling to avoid app hangs).Enhances Cardano deep-link support by attaching an optional
networkto relevantCardanoActiontypes, detecting mainnet vs preprod from addresses (including decimal amounts), and auto-switching the selected network before executing link actions; includes new tests and Android link test cases for decimal precision. Also bumps app version to7.0.3.Written by Cursor Bugbot for commit f922c87. This will update automatically on new commits. Configure here.